package com.yjf.demo.basic.user.controller;


import com.yjf.demo.basic.user.service.UserService;
import com.yjf.demo.common.ResponseResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequiredArgsConstructor
@RequestMapping("/user")
public class UserController {
    private final UserService userService;

    public record LoginParam(String username, String password) {
    }

    @PostMapping("/login")
    public ResponseResult<String> login(@RequestBody LoginParam loginParam) {
        return userService.login(loginParam);
    }

}
